package com.yanqu.road.server.cmd.activity.share;

import com.yanqu.road.pb.activity.ShareProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.share.ShareModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_SHARE_SUCCESS_REWARD, desc = "分享获取奖励")
public class ShareSuccessCmd extends AbstractCommand {
    private boolean isFXYL;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        ShareProto.ShareSuccessReqMsg msg = ShareProto.ShareSuccessReqMsg.parseFrom(packet.getBytes());
        isFXYL = msg.getIsFXYL();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(ShareModule.class).shareSuccess(isFXYL);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
